<!--# layout("/templates/layout/layout_main.html",{"title":"权限管理","nameSpace":"permission_admin","breadcrumbs":[{"name":"权限管理"}]}){ #-->
	<!--# var pager = obj.data.queryResult.pager ; #-->
	<table id="listTable" class="table  table-hover general-table table-striped table-bordered no-margin-bottom">
		<thead>
			<tr>
				<th colspan="9">
					<div class="row">
						<div class="col-md-3 ">
							<form action="${base}/permission/list" method="post" class="search-form">
								<div class="input-group">
									<span class="input-group-addon">关键字</span> <input type="text" class="form-control" placeholder="请输入关键词进行检索..." style="font-weight: 500" name="key"
										value="${obj.data.queryResult.pager.params.key}" data-default="Search..." data-error="请输入搜索关键词" placeholder="请输入角色名检索">
									<span class="input-group-addon search-btn" style="cursor: pointer;"><i class="fa fa-search"></i> GO</span>
								</div>
							</form>
						</div>
						
						<div class="col-md-3 col-md-offset-6">
							<a href="${base}/permission/toEdit" class="btn btn-primary btn-sm"><i class="fa fa-plus-circle"></i> 新增权限</a>
							<a href="${base}/userRole/toPermission" class="btn btn-success btn-sm"><i class="fa fa-plus-circle"></i> 设置权限</a>
						</div>
					</div>
				</th>
			</tr>
			<tr>
				<th class="center" style="width:35px;">
					<label class="pos-rel"><input type="checkbox" class="ace checkbox checkall" /><span class="lbl"></span></label>
				</th>
				<th class="center">序号</th>
				<th class="center">权限名称</th>
				<th class="center">权限描述</th>
				<th class="center">权限URL</th>
				<th class="center">是否菜单</th>
				<th class="center">前置权限</th>
				<th class="center">菜单图标</th>
				<th class="center">操作</th>
			</tr>
		</thead>
		<tbody>
			<!--# if(obj.data.queryResult.list.~size > 0){ #-->
				<!--# for(permission in obj.data.queryResult.list){ #-->
				<tr>
					<td  class="center">
						<label><input type='checkbox' name='ids' value="${permission.id}" class="ace checkbox"/><span class="lbl"></span></label>
					</td>
					<td  class="center">${(pager.pageNumber - 1)*pager.pageSize + permissionLP.index}</td>
					<td  class="">${permission.name}</td>
					<td  class="" >${permission.description}</td>
					<td  class="">${permission.url}</td>
					<td  class="center">
						<!--# if(permission.isMenu){ #-->
							<span class="label label-info arrowed-right arrowed-in">Yes</span>
						<!--# }else{ #-->
							<span class="label label-danger arrowed-right arrowed-in">No</span>
						<!--# } #-->
					</td>
					<td  class="">${permission.needPermission}</td>
					<td  class=""><i class="fa fa-${permission.icon}"></i>&nbsp;${permission.icon}</td>
					<td class="center">
						<div class="hidden-sm hidden-xs btn-group">
							<!-- <a class="btn btn-xs btn-success" title="角色权限" href="javascript:editUserRole()">
								<i class="ace-icon fa fa-cogs bigger-120" title="角色权限"></i>
							</a> -->
							<a class="btn btn-xs btn-warning" title="编辑" href="${base!}/permission/toEdit?id=${permission.id!}">
								<i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i>
							</a>
							<a class="btn btn-xs btn-danger" title="删除" onclick="batchDel('${permission.id}');">
								<i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i>
							</a>
						</div>
					</td>
				</tr>
				<!--# } #-->
			<!--#}else{ #-->
				<tr class="main_info">
					<td colspan="9" class="center">没有相关数据</td>
				</tr>
			<!--# } #-->
		</tbody>
	</table>
	<div style="padding-right:40px;">
		<div class="hr-6"></div>
		<ul class='pagination'></ul>
	</div>
	<div>&nbsp;</div>
	<div class="" id="dialogs">
		<div id="roleDialog" style="padding:10px;padding-left:20%;"  class="hidden">
			<div id="roleTree"></div>
		</div>
	</div>
<script type="text/javascript">
	$(function($) {
		
		$('.pagination')._pagination({pn:${pager.pageNumber},ps:${pager.pageSize},total:${pager.recordCount}});
		
	});
	
	/**
	 移除用户
	*/
	function batchDel(ids){
		if(ids == ''){
			return;
		}
		layer.confirm('确定要删除该权限？',function(){
			$.post(getRootPath() + '/permission/batchDel', {ids:ids}, function(r) {
				if (r.operationState == 'SUCCESS') {
					$('#edit-form').attr("action", location.href).submit();
				} else {
					layer.msg(r.data.reason);
				}
			}, 'json');
		});
	
	}
</script>
<!--# } #-->


 